package com.sean.reflect.aop1;

import java.lang.reflect.Proxy;

public class MainCal {
    public static void main(String[] args) {
        Cal cal = new Cal();
        MyInvocationHadler myInvocationHadler = new MyInvocationHadler((cal));

        MathCal mathCal = (MathCal) Proxy.newProxyInstance(MainCal.class.getClassLoader(),new Class[]{MathCal.class},myInvocationHadler);
        mathCal.add(1,2);
        mathCal.sub(1,2);
        mathCal.div(1,2);
        mathCal.multi(1,2);
    }
}
